/*
 *  差分模版
 * */

#include <iostream>
using namespace std;

const int N = 100010;
int n, m, l, r, c, x;
int a[N], b[N];

int main () {

    cin >> n >> m;

    for (int i = 1; i <= n; ++i) {
        cin >> a[i];
        b[i] = a[i] - a[i - 1];
    }

    for (int i = 1; i <= m; ++i) {
        cin >> l >> r >> c;
        b[l] += c;
        b[r + 1] -= c;
    }

    for (int i = 1; i <= n; ++i) {
        x += b[i];
        cout << x << " ";
    }

    return 0;
}